<!-- 会员中心主内容区 -->
<div class="page-article">
  <!-- 我的评论 -->
  <div id="member_aftersales" class="member-aftersales">
    <div class="member-tabs">
      <a href="<{link app=aftersales ctl=site_member act=go_addbilling}>"><em><{t}>增票资质<{/t}></em></a>
      <a href="<{link app=aftersales ctl=site_member act=apply_addbilling}>" class="active"><em><{t}>增值记录<{/t}></em></a>
    </div>
    <div class="member-mod member-aftersales-record">
      <table class="member-grid">
        <thead>
          <tr>
            <th><{t}>申请人ID<{/t}></th>
            <th><{t}>单位名称<{/t}></th>
            <th><{t}>纳税人识别码<{/t}></th>
            <th><{t}>注册地址<{/t}></th>
            <th><{t}>注册号码<{/t}></th>

            <th><{t}>开户银行<{/t}></th>
            <th><{t}>操作<{/t}></th>

          </tr>
        </thead>
        <{if count($addbilling_list)>0 }>
        <{foreach from=$addbilling_list item=list name=name}>
        <tbody class="<{if $smarty.foreach.name.iteration == 1}>first<{/if}>">
          <tr>
            <td class="order"><{$list.member_id}></td>
            <td class="subject"><{$list.company}></td>
            <td class="datetime"><{$list.company_taxpayer}></td>
            <td class="datetime"><{$list.company_addr}></td>
            <td class="datetime"><{$list.company_mobile}></td>
            <td class="datetime"><{$list.bank_account}></td>
            <td class="datetime">
            <a href="<{link app=aftersales ctl=site_member act=edit_addbilling arg0=$list.id}>" class="action-edit"><{t}>编辑<{/t}></a>
            <a href="<{link app=aftersales ctl=site_member act=del_apply arg0=$list.id}>" class="action-delete"><{t}>删除<{/t}></a>
            </td>


            <!-- <td class="subject"><{$list.admin_content}></td> -->
          </tr>
        </tbody>
        <{/foreach}>
        <{else}>
        <tbody>
        <tr class="first"><td colspan="5" class="no-information"><{t}>暂无增值记录<{/t}></td></tr>
        </tbody>
        <{/if}>
      </table>
    </div>
    <{pagers data=$pager}>
  </div>
</div>
<!-- <script src="localhost/ec_oubao/public/app/desktop/statics/js/moo.js"></script> -->
<script>

var Query = {
    options: function(url, data, method, fn){
        if(typeOf(data) == 'object') {
            data.request = true;
        }
        else if(typeOf(data) == 'element') {
            data = data.toQueryString() + '&response_json=true';
        }
        else if(typeOf(data) == 'string') {
            data = data + '&response_json=true';
        }
        else if(!data) {
            data = 'response_json=true';
        }
        return {
            url: url,
            method: method,
            data: data,
            link: 'cancel',
            onSuccess: function(rs) {
                try {
                    rs = JSON.decode(rs);
                }catch(e) {}
                if(rs && rs.error) return Message.error(rs.error);
                if(typeOf(fn) === 'function') fn.call(this,rs);
            },
            onFailure: function(e) {
                Message.error('<{t}>网络错误，请重试。<{/t}>');
            }
        };
    },
    load: function(url, update, data, fn) {
        new Request.HTML(Object.merge(Query.options(url, data, 'post', fn), {
            update: update
        })).send();
    },
    send: function(url, data, fn) {
        new Request(Query.options(url,data, 'post', fn)).send();
    }
}
// alert(send());
var address = $('member_aftersales');
var address_submit = $('member_address_submit');
var address_title = $('member_address_title');
var address_list = $('member_address_list');
address.addEvents({


    'click:relay(.action-delete)': function(e){
        e.preventDefault();
        var self = this;
        Dialog.confirm('<{t}>您确定要删除吗？<{/t}>', function(e){
            if(e) {
                Query.send(self.href, null, function(rs) {
                    self.getParent('tr').destroy();
                    address.getElement('.address-prompt .warn').innerHTML -= 1;
                });
            }
        });
    }
});

</script>
<script>


var submit = $('member_aftersales').getElement('button[type=submit]');
function ajax_callback1(type, msg, url) {
    if(type == 'error') {
        submit.removeClass('disabled');
    }
    return top.Message( msg, type, function(){
        if(url) location.href = url;
    });
}
</script>
